<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>登录 - 东格玛协调器</title>
		<link rel="stylesheet" href="css/amazeui.min.css" />
		<link rel="stylesheet" href="css/style.css" />
	</head>

	<body>
		<header class="am-topbar am-topbar-inverse nav">
			<div class="nav-main">
				<div class="nav-bg"></div>
				<div class="nav-mask">
					<h1 class="am-topbar-brand">
					   <a onclick="window.location.href='http://'+document.domain;"  style="color: #cecece;" href="#">dogma</a>
					</h1>
					<div class="am-collapse am-topbar-collapse" id="doc-topbar-collapse">
						<ul class="am-nav am-nav-pills am-topbar-nav">
						<li><a href="about.php">关于</a></li>
						</ul>
					</div>
				</div>
			</div>
		</header>
		<?php include 'action/islogin.php'; ?>
		<div class="login-panel">
			<div class="am-panel am-panel-default login-panel-child">
				<div class="am-panel-bd">
					<form class="am-form" method="post" action="<?php if($is_log==0){ ?>admin.php<?php }else{?>action/login.php<?php }?>">
						<legend>登录</legend>
						<?php if($is_log==0){ ?>
							<h2>Welcome home,<?php echo $_COOKIE['nickname']; ?>!</h2>
							<button type="submit" class="am-btn am-btn-default am-btn-block">进入控制台</button>
							<button type="button" id='leave' class="am-btn am-btn-default am-btn-block">退出登录</button>
						<?php }else{?>
						<div class="am-form-group am-form-icon">
							<i class="am-icon-user"></i>
							<input name='username' type="email" class="am-form-field" placeholder="email">
						</div>

						<div class="am-form-group am-form-icon">
							<i class="am-icon-lock"></i>
							<input name='password' type="password" class="am-form-field" placeholder="password">
						</div>
						<button type="submit" class="am-btn am-btn-default am-btn-block">登录</button>
						<?php }?>
					</form>
					<br />
					<?php if($is_log==1){ ?>
					<a data-am-modal="{target: '#reg'}" style="float: right;">注册账号</a>
					<?php }?>
					<br />
				</div>
			</div>
		</div>
		<div id='saying-panel' class="notice am-animation-slide-left">
			<div class="am-panel am-panel-default notice-child">
				<div class="am-panel-bd notice-info" id='saying'>
					<?php include "action/saying.php";?>
				</div>
			</div>
		</div>
		<div class="footer">
			图片来自网络，侵权跪下道歉
			<br/>
			Copyleft © 2016 <a style="color: rgba(255, 255, 255, 0.55);" href="https://www.syana.moe/">q6q64399</a>.
		</div>
		<div class="am-popup" id="reg" style="height: 270px;">
	<div class="am-popup-inner">
		<div class="am-popup-hd">
			<h4 class="am-popup-title">
				注册
			</h4>
			<span data-am-modal-close
			class="am-close">&times;</span>
		</div>
		<div class="am-popup-bd">
			<form method="post" action="action/reg.php">
				<div class="am-form-group">
					<label >邮箱：</label>
					<input type="email" style="width: 80%;" name="username" placeholder="输入你的邮箱">
				</div>
				<div class="am-form-group">
					<label >密码：</label>
					<input type="password" style="width: 80%;" name="password" placeholder="设置一个安全的密码吧（6-16字数，数字，英文）">
				</div>
				<div class="am-form-group">
					<label >昵称：</label>
					<input type="text" style="width: 80%;"  name="nickname" placeholder="取一个炫酷的名字吧（2-15字数，数字，英文，汉字）">
				</div>
				
				<button type="submit"  style="margin-left:5px; float:right;" id="addsoft" class="am-btn am-btn-success">
					注册
				</button>
			</form>
		</div>
	</div>
</div>
		<script src="//cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
		<script src="//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.js"></script>
		<script type="text/javascript" src="js/amazeui.min.js" ></script>
		<script type="text/javascript" src="js/saying.js" ></script>
		<script>
			$("#leave").click(function() {
				$.cookie('check', null, {
					path: '/',
					expires: -1
				});
				$.cookie('nickname', null, {
					path: '/',
					expires: -1
				});
				location.reload();
			});
		</script>
	</body>

</html>